package lzzy.edu.cn.demothymeleaf.controller;

import lzzy.edu.cn.demothymeleaf.service.ArticleService;
import lzzy.edu.cn.demothymeleaf.service.Task;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @PostMapping("/test")
    public String test() {
        return "test";
    }
    //RabbitMQ
    @Autowired
    private RabbitTemplate rabbitTemplate;

//    @GetMapping("/send")
//    public void send() {
//        rabbitTemplate.convertAndSend("fanout_exchange","", "这是一条广播信息");
//    }
//
//    @Autowired
//    Task task;
//
//
//    @GetMapping("/task")
//    public String task() throws InterruptedException {
//        task.synTask();
//        return "陈国飞";
//    }
}

